#include "stdafx.h"
#include "TextDrawer.h"
#include "PFMEngine.h"

TextDrawer::TextDrawer()
{}

TextDrawer::~TextDrawer()
{
	Release();
}

void TextDrawer::Create(TextElement* pTextElement, const char* pText, int nPosX, int nPosY)
{
	m_pTextElement = pTextElement;
	SetText(pText);
	SetPos(nPosX, nPosY);
}

void TextDrawer::Release()
{
	GetPFMEngine().ReleaseText(m_pTextElement);
}

void TextDrawer::Update()
{
	GetPFMEngine().AddDrawElement(m_pTextElement);
}

void TextDrawer::SetText(const char* pText)
{
	m_pTextElement->SetText(pText);
}

void TextDrawer::SetPos(int nPosX, int nPosY)
{
	m_pTextElement->SetPos(nPosX, nPosY);
}

void TextDrawer::SetColor( D3DXCOLOR color )
{
	m_pTextElement->SetColor( color );
}

